package com.dhp.bkOjuserservice.controller;

import com.dhp.bkOjfeignclient.service.userFeignClient;
import com.dhp.bkOjuserservice.service.UserService;
import com.dhp.model.entity.User;
import com.dhp.model.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Collection;
import java.util.List;

/**
 * userFeignClient实现
 */
@RestController
@RequestMapping("/user/inner")
public class UserFeignController implements userFeignClient {

    @Autowired
    private UserService userService;

    @Override
    @GetMapping("/get/id")
    public User getById(@RequestParam("userId") Long userId) {
        return userService.getById(userId);
    }

    @Override
    public List<User> listByIds(Collection<Long> ids) {
        return userService.listByIds(ids);
    }

}
